<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />

<html>
	<head>
		<title>物流公司管理</title>

		<script type="text/javascript">
	$(document).ready(function() {
		//聚焦第一个输入框
		$("#logisticsFullName").focus();
		//为inputForm注册validate函数
		$("#inputForm").validate();
	});

	$(function() {
		$("#submit_btn").click(function() {
			var val = $('input:radio[name="corpLevel"]:checked').val();
			if (val == null) {
				$("#radioId").show();
				$("#radioId").html("<font color=\"red\">请选择一个</font>");
				return false;
			} 
			else {
				//$("#submit_btn").attr("disabled", "disabled");
				return true;
			}
		});
	});
</script>
	</head>

	<body>
	<section class="content">
<div class="row">
		<div class="col-md-12">

			<!-- Primary box -->
			<div class="box box-solid box-primary">
				<div class="box-header">
					<i class="fa fa-edit"></i>
					<h3 class="box-title">${titlePage}</h3>
					<div class="box-tools pull-right">
						<button class="btn btn-primary btn-sm" data-widget="collapse">
							<i class="fa fa-minus"></i>
						</button>
					</div>
				</div>
				<div class="box-body">
		<form id="inputForm" action="${ctx}/v2/logistics/${action}" method="post"
			class="form-horizontal">
			<input type="hidden" name="id" value="${logistics.id}" />
			<fieldset>
				<div class="form-group">
					<label for="logistics.fullName" class="col-sm-3 control-label">
						公司全名:
					</label>
					<div class="col-sm-6">
						<input type="text" id="logisticsFullName" name="fullName"
							value="${logistics.fullName}" class="form-control input-large required"
							minlength="3" />
					</div>
				</div>
				<div class="form-group">
					<label for="logistics.companyName" class="col-sm-3 control-label">
						公司简称:
					</label>
					<div class="col-sm-6">
						<input type="text" id="logisticsCompanyName" name="companyName"
							value="${logistics.companyName}" class="form-control input-large required"
							minlength="2" />
					</div>
				</div>
				<div class="form-group">
					<label for="logistics.companyCode" class="col-sm-3 control-label">
						公司代码:
					</label>
					<div class="col-sm-6">
						<input type="text" id="logisticsCompanyCode" name="companyCode"
							value="${logistics.companyCode}" class="form-control input-large required"
							minlength="2" />
					</div>
				</div>
				<div class="form-group">
					<label for="logistics.regMailNo" class="col-sm-3 control-label">
						运单号正则表达式:
					</label>
					<div class="col-sm-6">
						<input type="text" id="logisticsRegMailNo" name="regMailNo"
							value="${logistics.regMailNo}" class="form-control input-large required"
							minlength="3" />
					</div>
				</div>
				<div class="form-group">
					<label for="logistics.customerServiceTel" class="col-sm-3 control-label">
						客服电话:
					</label>
					<div class="col-sm-6">
						<input type="text" id="logisticsCustomerServiceTel"
							name="customerServiceTel" value="${logistics.customerServiceTel}"
							class="form-control input-large required" minlength="3" />
					</div>
				</div>
				<div class="form-group">
					<label for="logistics_corpLevel" class="col-sm-3 control-label">
						公司级别:
					</label>
					<div class="col-sm-6">
						<input type="radio" name="corpLevel" value="auth"
							<c:if test="${logistics.corpLevel eq 'auth'}">checked="checked"</c:if>>
						认证
						<input type="radio" name="corpLevel" value="brand"
							<c:if test="${logistics.corpLevel eq 'brand'}">checked="checked"</c:if>>
						品牌

						<input type="radio" name="corpLevel" value="noAuth"
							<c:if test="${logistics.corpLevel eq 'noAuth'}">checked="checked"</c:if>>
						未认证

						<input type="radio" name="corpLevel" value="normal"
							<c:if test="${logistics.corpLevel eq 'normal'}">checked="checked"</c:if>>
						普通
						<span id="radioId" style="display: none"></span>
					</div>
				</div>
				<div class="modal-footer bg-gray">
					<c:if test="${status eq 0 }">
						<input id="submit_btn" class="btn btn-primary" type="submit"
							value="增加" />
					</c:if>
					<c:if test="${status eq 1 }">
						<input id="submit_btn" class="btn btn-primary" type="submit"
							value="更新" />
					</c:if>
					&nbsp;
					<input id="cancel_btn" class="btn btn-default" type="button" value="返回"
						onclick="history.back()" />
				</div>
			</fieldset>
		</form>
		</div>
		</div>
		</div>
		</div>
		</section>
	</body>
</html>
